'use strict';

module.exports = app => {
  const { STRING, INTEGER, DATE ,UUID,TEXT} = app.Sequelize;
  var moment = require('moment');

  const fd_recharge = app.model.define('fd_recharge', {
    id: { type: UUID, primaryKey: true},
    username:STRING(255),//充值账号，
    money:STRING(10),//充值金额，
    created_by:STRING(50),//处理人，
    created_at: {
      type: DATE,
      get() {
        return moment(this.getDataValue('created_at')).format('YYYY-MM-DD HH:mm:ss');
      }
    },
    updated_at: {
      type: DATE,
      get() {
        return moment(this.getDataValue('updated_at')).format('YYYY-MM-DD HH:mm:ss');
      }
    }
  },{freezeTableName: true,timestamps: true})

  return fd_recharge;
};
